<?php
/**
 * Created by PhpStorm.
 * User: dx
 * Date: 16/2/19
 * Time: 下午4:20
 */
class CouponBaseInfo extends Eloquent
{
    protected $table = "coupon_base_info";

    public static function getImageName()
    {
        return time() . '-' . rand(1, 99999) . '.png';
    }

    /*
     * 券码类型 1-随机码 2-统一码
     * */
    public static $code_type = array(
        "1"=>"随机码",
        "2"=>"统一码",
    );

    /*
 *  类型 1-抵用券
 * */
    public static $type = array(
        "1" => "订单减免券",
        "2" => "服务抵用券",
        "3" => "实物抵用券",
        "4" => "服务减免券",
        "5" => "服务折扣券"
    );

    public static function getCouponBaseInfo($id){
        return CouponBaseInfo::where('id',$id)->where('status',1)->first();
    }

}